<script setup>
import {onUpdated, ref} from "vue";
import {useRouter} from "vue-router";
/*
userRouter：接收路径参数
router.params:获得路径的参数
router.query:获得键值对参数
 */
let languageId = ref(0)
let languageName = ref('')
let router = useRouter()
languageId.value = router.currentRoute.value.params.id
languageName.value = router.currentRoute.value.params.language

onUpdated(() => {
      languageId.value = router.currentRoute.value.params.id
      languageName.value = router.currentRoute.value.params.language
    }
)
</script>

<template>
  <div>
    <h1>showDetail接收路径参数</h1>
    <h3>{{ languageId }}-{{ languageName }}是世界上最好的语言</h3>
  </div>
</template>

<style scoped>

</style>